package com.tron.dobest.kafka;

import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class KafkaSendServer {

    private final KafkaTemplate<String,Object> kafkaTemplate;

    public KafkaSendServer(KafkaTemplate<String,Object> kafkaTemplate) {
        this.kafkaTemplate = kafkaTemplate;
    }

    public String sendMsg(String msg) {
        kafkaTemplate.send("TOPIC_01", msg);
        return "success";
    }
}
